import { createStore } from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import user from './modules/user'
import car from './modules/car'
import category from './modules/category'
// import getters from './getters'

// vue2.0 创建仓库 new Vuex.Store({})
// vue3.o 创建仓库 createStore({})
export default createStore({

  modules: {
    user,
    car,
    category
  },
  // 这样是默认存储到localStorage
  plugins: [createPersistedState({
    // 本地存储名字
    key: 'erabbit-client-pc-124-sotre',
    // 指定需要存储的模块
    paths: ['user', 'car']

  })]
})
